Symstra: A Framework for Generating Object-Oriented Unit Tests Using Symbolic Execution
نویسندگان
چکیده
Object-oriented unit tests consist of sequences of method invocations. Behavior of an invocation depends on the method’s arguments and the state of the receiver at the beginning of the invocation. Correspondingly, generating unit tests involves two tasks: generating method sequences that build relevant receiverobject states and generating relevant method arguments. This paper proposes Symstra, a framework that achieves both test generation tasks using symbolic execution of method sequences with symbolic arguments. The paper defines symbolic states of object-oriented programs and novel comparisons of states. Given a set of methods from the class under test and a bound on the length of sequences, Symstra systematically explores the object-state space of the class and prunes this exploration based on the state comparisons. Experimental results show that Symstra generates unit tests that achieve higher branch coverage faster than the existing test-generation techniques based on concrete method arguments.
منابع مشابه
Improving Structural Testing of Object-Oriented Programs via Integrating Evolutionary Testing and Symbolic Execution by
INKUMSAH, KOBI K. Improving Structural Testing of Object-Oriented Programs via Integrating Evolutionary Testing and Symbolic Execution. (Under the direction of Dr. Tao Xie). Achieving high structural coverage such as branch coverage in object-oriented programs is an important and yet challenging goal due to two main challenges. First, some branches involve complex program logics and generating ...
متن کاملDyGen: Automatic Generation of High-Coverage Tests via Mining Gigabytes of Dynamic Traces
Unit tests of object-oriented code exercise particular sequences of method calls. A key problem when automatically generating unit tests that achieve high structural code coverage is the selection of relevant method-call sequences, since the number of potentially relevant sequences explodes with the number of methods. To address this issue, we propose a novel approach, called DyGen, that genera...
متن کاملAutomatic generation of object oriented unit tests using genetic programming
Automating the generation of object-oriented unit tests for structural testing techniques has been challenging many researchers due to the benefits it promises in terms of cost saving and test quality improvement. It requires test sequences to be generated, each of which models a particular scenario in which the class under test is examined. The generation process aims at obtaining a preferably...
متن کاملGenerating Fixtures for JavaScript Unit Testing
In today’s web applications, JavaScript code interacts with the Document Object Model (DOM) at runtime. This runtime interaction between JavaScript and the DOM is errorprone and challenging to test. In order to unit test a JavaScript function that has read/write DOM operations, a DOM instance has to be provided as a test fixture. This DOM fixture needs to be in the exact structure expected by t...
متن کاملCOTT – A Testability Framework for Object-Oriented Software Testing
Testable software has two inherent properties – observability and controllability. Observability facilitates observation of internal behavior of software to required degree of detail. Controllability allows creation of difficult-to-achieve states prior to execution of various tests. In this paper, we describe COTT, a Controllability and Observability Testing Tool, to create testable object-orie...
متن کامل